package com.blockchain.console.service.content;

import com.blockchain.common.enums.QuestionType;
import com.blockchain.console.service.content.entity.QuestionRecord;
import com.blockchain.console.service.content.query.QuestionQuery;
import com.blockchain.framework.service.Service;
import com.blockchain.framework.service.query.Paging;
import com.blockchain.framework.service.query.PagingResult;

public interface QuestionManage extends Service{

	/**
	 * 获取常见问题，分页
	 * @param question
	 * @param paging
	 * @return
	 * @throws Throwable
	 */
	public abstract PagingResult<QuestionRecord> search(String question,QuestionType qt,
			Paging paging) throws Throwable;
	/**
	 * 添加问题
	 * @param query
	 * @throws Throwable
	 */
	public abstract int addQuestion(QuestionQuery query) throws Throwable;
	/**
	 * 删除问题
	 * @param ids
	 * @throws Throwable
	 */
	public abstract void delete(int... ids) throws Throwable;
	/**
	 * 修改问题
	 * @param query
	 * @param id
	 * @throws Throwable
	 */
	public abstract void updateQuestion(QuestionQuery query,int id) throws Throwable;
	
	/**
	 * 根据id获取对象
	 * @param id
	 * @return
	 * @throws Throwable
	 */
	public abstract QuestionRecord getQuestion(int id) throws Throwable;
	
	/**
	 * 根据排序值获取实体对象
	 * @param id
	 * @return
	 * @throws Throwable
	 */
	public abstract QuestionRecord getQueryIndex(int pxz,QuestionType questionType) throws Throwable;
	/**
	 * 修改排序值
	 * @param query
	 * @param id
	 * @throws Throwable
	 */
	public abstract void updateQuestionPxz(int id,int pxz) throws Throwable;
}
